package com.ruo.goods.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.ruo.common.core.domain.R;
import com.ruo.goods.domain.PmsProduct;
import com.ruo.goods.domain.vo.PmsProductQuery;
import com.ruo.goods.mapper.PmsProductMapper;
import com.ruo.goods.service.PmsProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author：尚志豪
 * @Package：com.ruo.goods.service.impl
 * @Project：ruoi
 * @name：PmsProductServiceImpl
 * @Date：2024/7/22 20:22
 */
@Service
public class PmsProductServiceImpl implements PmsProductService {
    @Autowired
    private PmsProductMapper pmsProductMapper;
    /**
     * 列表
     */
    @Override
    public R<PageInfo<PmsProduct>> list(PmsProductQuery query) {
        PageHelper.startPage(query.getPageNum(),query.getPageSize());
        List<PmsProduct> productList = pmsProductMapper.list(query);
        PageInfo<PmsProduct> info = new PageInfo<>(productList);
        return R.ok(info);
    }
}
